USE [AmazonMWS]
GO

/****** Object:  Table [con].[AmazonOrdersDetails]    Script Date: 11/08/2015 23:57:22 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [con].[AmazonOrdersDetails](
	[AmazonOrdersDetailsID] [int] IDENTITY(1,1) NOT NULL,
	[SiteId] [int] NULL,
	[AccountInfoId] [int] NOT NULL,
	[AmazonOrderId] [nvarchar](20) NULL,
	[OrderItemId] [nvarchar](20) NOT NULL,
	[ASIN] [nvarchar](12) NOT NULL,
	[SellerSKU] [nvarchar](20) NULL,
	[Title] [nvarchar](200) NOT NULL,
	[QuantityOrdered] [decimal](18, 0) NULL,
	[QuantityShipped] [decimal](18, 0) NULL,
	[ItemPriceCurrencyCode] [nvarchar](10) NULL,
	[ItemPriceAmount] [decimal](18, 2) NULL,
	[ShippingPriceCurrencyCode] [nvarchar](10) NULL,
	[ShippingPriceAmount] [decimal](18, 2) NULL,
	[GiftWrapPriceCurrencyCode] [nvarchar](10) NULL,
	[GiftWrapPriceAmount] [decimal](18, 2) NULL,
	[ItemTaxCurrencyCode] [nvarchar](10) NULL,
	[ItemTaxAmount] [decimal](18, 2) NULL,
	[ShippingTaxCurrencyCode] [nvarchar](10) NULL,
	[ShippingTaxAmount] [decimal](18, 2) NULL,
	[GiftWrapTaxCurrencyCode] [nvarchar](10) NULL,
	[GiftWrapTaxAmount] [decimal](18, 2) NULL,
	[ShippingDiscountCurrencyCode] [nvarchar](10) NULL,
	[ShippingDiscountAmount] [decimal](18, 2) NULL,
	[PromotionDiscountCurrencyCode] [nvarchar](10) NULL,
	[PromotionDiscountAmount] [decimal](18, 2) NULL,
	[PromotionIds] [nvarchar](100) NULL,
	[CODFeeCurrencyCode] [nvarchar](20) NULL,
	[CODFeeAmount] [decimal](18, 2) NULL,
	[CODFeeDiscountCurrencyCode] [nvarchar](10) NULL,
	[CODFeeDiscountAmount] [decimal](18, 2) NULL,
	[GiftMessageText] [nvarchar](50) NULL,
	[GiftWrapLevel] [nvarchar](50) NULL,
	[ConditionNote] [nvarchar](100) NULL,
	[ConditionId] [nvarchar](50) NULL,
	[ConditionSubtypeId] [nvarchar](50) NULL,
	[ScheduledDeliveryStartDate] [nvarchar](50) NULL,
	[ScheduledDeliveryEndDate] [nvarchar](50) NULL,
	[BuyerSelectedInvoiceCategory] [nvarchar](50) NULL,
	[InvoiceInformation] [nvarchar](50) NULL,
	[InvoiceRequirement] [nvarchar](50) NULL,
	[InvoiceTitle] [nvarchar](50) NULL,
	[IsDel] [bit] NULL,
	[CreateUser] [nvarchar](20) NULL,
	[CreateTime] [datetime] NULL,
	[UpdateUser] [nvarchar](20) NULL,
	[UpdateTime] [datetime] NULL,
PRIMARY KEY CLUSTERED 
(
	[AmazonOrdersDetailsID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [con].[AmazonOrdersDetails] ADD  DEFAULT ((0)) FOR [IsDel]
GO

ALTER TABLE [con].[AmazonOrdersDetails] ADD  DEFAULT ('Pu') FOR [CreateUser]
GO

ALTER TABLE [con].[AmazonOrdersDetails] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO

ALTER TABLE [con].[AmazonOrdersDetails] ADD  DEFAULT ('FL') FOR [UpdateUser]
GO

ALTER TABLE [con].[AmazonOrdersDetails] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO

